from django.db.models.signals import class_prepared

def longer_email_username(sender, *args, **kwargs):
    # You can't just do `if sender == django.contrib.auth.models.User`
    # because you would have to import the model
    # You have to test using __name__ and __module__
    if (sender.__name__ in ("User", "UserProfile") and
        sender.__module__ in ("django.contrib.auth.models", "mitems.models")):
        sender._meta.get_field("username").max_length = 100
        sender._meta.get_field("email").max_length = 300

class_prepared.connect(longer_email_username)